﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PNProject.Core;
using PNProject.Core.Converter;

namespace PNProject.Controllers
{
    public class ModulesController : Controller
    {
        //
        // GET: /Modules/

        public ActionResult Feedback()
        {
            return View(new FeedbackModel());
        }

        [HttpPost]
        public ActionResult Feedback(FeedbackModel feed)
        {
            feed.FeedbackID = Guid.NewGuid().ToString();
            var fb = FeedbackConverter.ToFeedback(feed);
            fb.SentDate = DateTime.Now;
            fb.Type = 0;
            StaticData.feedbackRepo.Save(null, fb);
            return RedirectToAction("feedback", "Modules");
        }

    }
}
